
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/view/modules/sys/include/taglib.jsp"%>
<%@ include file="/WEB-INF/view/modules/sys/include/head.jsp"%>

<div class="main-container">
    <div class="padding-md">
        <div class="smart-widget-body">
            <form action="${ctx}/link/add" method="post" class="form-horizontal no-margin"
                  id="addlink-form">
                <div class="form-group">
                    <label class="control-label col-lg-3">网站名称</label>
                    <div class="col-lg-9">
                        <input type="text"  name="linkName" class="form-control input-sm"  placeholder="请输入网站名称">
                    </div><!-- /.col -->
                </div><!-- /form-group -->
                <div class="form-group">
                    <label class="control-label col-lg-3">网站地址</label>
                    <div class="col-lg-9">
                        <input type="text"  name="url" class="form-control input-sm"  placeholder="请输入网站地址">
                    </div><!-- /.col -->
                </div><!-- /form-group -->
                <div class="form-group">
                    <label class="control-label col-lg-3">顺序</label>
                    <div class="col-lg-9">
                        <input type="number"  name="linkWeight" class="form-control input-sm"  placeholder="请输入数字">
                    </div><!-- /.col -->
                </div><!-- /form-group -->

                <div class="form-group">
                    <label class="control-label col-lg-3">标记</label>
                    <div class="col-lg-9">
                        <input type="text" name="linkFlag" class="form-control input-sm"  placeholder="请输入数字">
                    </div><!-- /.col -->
                </div><!-- /form-group -->
                <div class="text-right m-top-md" align="">
                    <button type="submit" class="btn btn-info">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>

<script>
    $(function() {
        $("#addlink-form").validate({
            rules:{
                linkName:"required",
                url:"required",
                linkWeight:{
                    number:true,
                    min:0,
                    max:10
                },
                linkFlag:{
                    number:true,
                    min:0,
                    max:4
                }
            },
            messages:{
                linkName:{
                    required:"请输入名称"
                },
                url:{
                    required:"请输入链接地址"
                },
                linkWeight:{
                    number:"必须是数字",
                    min:"最小数字为0",
                    max:"最大数字不能超过10"
                },
                linkFlag:{
                    number:"必须是数字",
                    min:"最小数字为0",
                    max:"最大数字不能超过4"
                }
            }
        });

    });
</script>

<%@include file="/WEB-INF/view/modules/sys/include/footerlib.jsp"%>
</body>

</html>

